<?php
session_start();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <title>GlucoDiary - Fehler melden</title>
  <link rel="stylesheet" type="text/css" href="werte_style.css">
  <link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico">
</head>
<body>
<?php
if(!isset($_SESSION['name']))
{
  echo "Ups! Du bist nicht angemeldet!";
}
else
{ 
  if($_GET['d'] == "send")
  {
    mail("stefan.elitz@gmail.com", "GlucoDiary: ".$_POST['subject'], $_POST['text'], "from:".$_SESSION['email']);
    ?>
    <script type="text/javascript" language="JavaScript">
    self.close();
    </script>
    <?php
  }
  else
  {
  ?>
  <h1>Fehler melden:</h1>
  <form action="reportbug.php?d=send&<?php echo SID?>" method="post" id="reportbug"><br>
  Betreff: <input type="text" style="width: 352px;" name="subject">
  <textarea name="text" rows="5" style="width: 400px;">Beschreibung</textarea><br>
  <input type="submit" value=" Absenden ">
  </form>
<?php
}
}
?>
</body>
</html>